package huachenxing.mimi520.option.models
{
	import huachenxing.mimi520.tools.ConfigFile;

	public class AccountModel
	{
		public static var username:String = "";
		public static var password:String = "";
		
		public static function fromConfig():void
		{
			var config:ConfigFile = new ConfigFile("account");
			config.read();
			
			for(var key:String in config)
			{
				var value:String = config[key];
				try { AccountModel[key] = value; }
				catch(e) {}
			}
		}
		
		public static function toConfig():void
		{
			var config:ConfigFile = new ConfigFile("account");
			config["username"] = AccountModel.username;
			config["password"] = AccountModel.password;
			config.write();
		}
	}
}